import java.util.Scanner;

/**
 * 查找整数
 */
public class FindInteger {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x[] = new int[n];
        for (int i = 0 ; i < n ; i++){
            x[i] = sc.nextInt();
        }
        int a = sc.nextInt();
        int i;
        for (i = 0 ; i < x.length ; i++){
            if(x[i] == a) {
                System.out.println(i+1);
                break;
            }
        }
        if (i >= x.length) System.out.println(-1);
    }
}
